package com.svms.service.factory;

import com.svms.service.dml.iface.NumberGeneratorDMLIF;
import com.svms.service.iface.AlertIF;
import com.svms.service.iface.IndentIF;
import com.svms.service.iface.MovementIF;
import com.svms.service.iface.SpareDetailsIF;
import com.svms.service.iface.TransportIF;
import com.svms.service.iface.VehicleIF;

/**
 * @author om39a
 * 
 *         This is a factory class. Used by both service and web to intitlize
 *         the BO's used in service.
 * 
 */
public class SvmsServiceFactory {

	private static SvmsServiceFactory svmsServiceFactory;
	private VehicleIF vehicle;
	private MovementIF movement;
	private TransportIF transport;
	private IndentIF indent;
	private NumberGeneratorDMLIF numberGenerator;
	private AlertIF alert;
	private SpareDetailsIF spareDetails;

	private SvmsServiceFactory() {

	}

	public VehicleIF getVehicle() {
		return vehicle;
	}

	public void setVehicle(VehicleIF vehicle) {
		this.vehicle = vehicle;
	}

	public MovementIF getMovement() {
		return movement;
	}

	public void setMovement(MovementIF movement) {
		this.movement = movement;
	}

	public TransportIF getTransport() {
		return transport;
	}

	public void setTransport(TransportIF transport) {
		this.transport = transport;
	}

	public IndentIF getIndent() {
		return indent;
	}

	public void setIndent(IndentIF indent) {
		this.indent = indent;
	}

	public NumberGeneratorDMLIF getNumberGenerator() {
		return numberGenerator;
	}

	public void setNumberGenerator(NumberGeneratorDMLIF numberGenerator) {
		this.numberGenerator = numberGenerator;
	}

	public AlertIF getAlert() {
		return alert;
	}

	public void setAlert(AlertIF alert) {
		this.alert = alert;
	}

	public static synchronized SvmsServiceFactory getInstance() {

		if (svmsServiceFactory == null) {
			svmsServiceFactory = new SvmsServiceFactory();
		}
		return svmsServiceFactory;
	}

	public SpareDetailsIF getSpareDetails() {
		return spareDetails;
	}

	public void setSpareDetails(SpareDetailsIF spareDetails) {
		this.spareDetails = spareDetails;
	}

}
